package com.google.code.pokerstats_service;

import java.io.Serializable;

/**
 * Statistics regarding a single player.
 * @author DL
 */
public class PlayerStats implements Serializable {
    /** Public default constructor (for exporting from web-service). */
    public PlayerStats() {}
    
    public PlayerStats(Long fbUid) {
        this.fbUid = fbUid;
        this.gamesPlayed = 0;
        this.totalBuyIns = 0.0;
        this.totalCashOuts = 0.0;
        this.expectation = 0.0;
        this.stdev = 0.0;
        this.pokerRank = 0.0;
        this.groupPlayed = 0;
        this.groupExpectation = 0.0;
        this.riskOfRuin = 0.0;
        this.nemesisFbUid = 0L;
        this.sidekickFbUid = 0L;
    }
    
    /** @see Object#toString */
    @Override
    public String toString() { 
        StringBuffer str = new StringBuffer();
        str.append(fbUid);
        str.append(": N=").append(gamesPlayed);
        str.append(", total=").append(totalCashOuts - totalBuyIns);
        str.append(", exp=").append(expectation);
        str.append(", grpN=").append(groupPlayed);
        str.append(", grpExp=").append(groupExpectation);
        str.append(", rnk=").append(pokerRank);
        str.append(", ror=").append(riskOfRuin);
        str.append(", nms=").append(nemesisFbUid);
        
        return str.toString();
    }
    
    /** Player's Facebook id. */
    public Long fbUid;
    
    /** Number of games played. */
    public Integer gamesPlayed;
    
    /** Total money invested by player. */
    public Double totalBuyIns;
    
    /** Total money earned by player. */
    public Double totalCashOuts;
    
    /** Player's profit expectation (0 if no games played). */
    public Double expectation;
    
    /** Player's profit standard deviation (0 if no games played). */
    public Double stdev;
    
    /** Player's PokerRank. */
    public Double pokerRank;
    
    /** Number of unique player-groups played. */
    public Integer groupPlayed;

    /** Player's player-group weighted expectation. */
    public Double groupExpectation;

    /** Player's Risk of Ruin under Uncertainty (RoRU). */
    public Double riskOfRuin;

    /** Nemesis' facebook id. */
    public Long nemesisFbUid;

    /** Sidekick's facebook id. */
    public Long sidekickFbUid;
    
    private static final long serialVersionUID = -329432259137265192L;
}